package meterMonitor.biz;

import meterMonitor.mapper.AreaMapper;
import meterMonitor.model.Area;
import meterMonitor.model.Meter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 区域：server层
*/
@Service
public class AreaBiz extends BaseBiz {
    @Autowired
    AreaMapper areaMapper;
    @Autowired
    MeterBiz meterBiz;
    /**
     *
     * @return 查询所有/单个区域对像
     */
    public List<Area> getfandAllArea(Integer areaId){

        return areaMapper.getfandAllArea(areaId);
    }

    //根据区域名称查区域
    public Area getFindArea(String areaName){
        return areaMapper.getFindArea(areaName);
    }
    /**
     *
     * @param areaId 删除单个区域
     */
    public void delArea(Integer areaId) {
        areaMapper.delArea(areaId);
    }

    /**
     * 新增区域
     * @param area
     */
    public void insertArea(Area area){
        areaMapper.insertArea(area);
    }


    /**
     * 根据区域id查区域
     */

    public Area getArea(int areaId){

        return areaMapper.getArea(areaId);
    }

    /**
     * 根据区域名字查区域
     */

    public Area getAreaByName(String areaName){

        return areaMapper.getAreaByName(areaName);
    }

    /**
     * 修改区域
     * @param area
     */
    public void updateArea(Area area) {
        areaMapper.updateArea(area);
    }
}
